<?php

namespace App\model;

use Illuminate\Database\Eloquent\Model;

/**
 * App\model\TuiguangSource
 *
 * @property int $source_id
 * @property string|null $name
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\TuiguangSource newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\TuiguangSource newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\TuiguangSource query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\TuiguangSource whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\TuiguangSource whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\TuiguangSource whereSourceId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\TuiguangSource whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class TuiguangSource extends Model
{
    protected $table = 'tuiguang_source';
    protected $primaryKey = 'source_id';
    public static function getSelectOptions()
    {
        $options = \DB::table('tuiguang_source')->select('source_id as id','name as text')->get();
        $selectOption = [];
        foreach ($options as $option){
            $selectOption[$option->id] = $option->text;
        }
        return $selectOption;
    }
}
